<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>IFELSE条件语句</title>
</head>
<body>
<div id="app">
    <template v-if="loginType === 'username'">
        <label>Username</label>
        <!--<input placeholder="Enter your username"  key="username-input">-->
        <input placeholder="Enter your username">
    </template>
    <template v-else>
        <label>Email</label>
        <input placeholder="Enter your email address">
    </template>
    <br>
    <input type="button" @click="updateinputtype" value="切换，保存内容">


    <li v-for=""></li>
</div>
<script src="../modules/vue.js"></script>
<script>
    let appdata = {
        loginType: 'username'
    }

    let vm = new Vue({
        el: '#app',
        data: appdata,
        methods: {
            updateinputtype: function () {
                this.loginType = this.loginType == 'username' ? 'username1' : 'username'
            }
        }
    })


</script>
</body>
</html>